﻿// Implements a label where it is generally a text or html
define([
    'Wjs/ui/widgets/foundation/ViewSingleContainer'
],
function () {
    'use strict';

    return Wjs.defineOnce({

        type: 'Label',

        internal: {

            base: Wjs.getType('ViewSingleContainer'),

            initialize: function () {

                this.addClass('wjs-label');
            }
        },

        setText: function (text) {

            this.setItem(

                Wjs.new('Text')
                    .setText(text)
            );

            return this;
        },

        setHtml: function (html) {

            this.setItem(

                Wjs.new('Html')
                    .setHtml(html)
            );

            return this;
        }

    });

});